<template>
  <el-dialog title="修改信息" :visible="isVisible" :before-close="hide">
    <!-- <span style="width: 150px">{{ standard.name }}: </span>
    <el-input v-model="standard.content" style="width: 200px" /> -->

    <el-form :model="standard" label-width="200px">
      <el-form-item :label="StandardEnum[standard.name]">
        <el-input v-model="standard.content" style="width: 200px" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="edit">修改</el-button>
        <el-button @click="hide">取消</el-button>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>

<script>
import {StatusEnum} from "@/utils/enum/standardEnum";

export default {
  props: {
    isVisible: {
      type: Boolean,
      required: false,
      default: false,
    },
    standard: {
      type: Object,
      required: false,
      default: {},
    },
  },
  data() {
    return {
      StandardEnum: StatusEnum,
    };
  },
  created() {
  },
  methods: {
    edit() {
      let data = {
        name: this.standard.name,
        content: this.standard.content,
        url: "/basic/standard/update",
      };
      this.$store.dispatch("request/post", data).then(() => {
        this.$emit("updateData")
        this.$emit("hide");
      });
    },
    hide() {
      this.$emit("hide");
    },
  },
};
</script>

<style lang="scss" scoped>
</style>